package com.hooya.fa.eu.biz.dao.mapper;

import com.hooya.fa.eu.api.bo.SellPriceBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * @Description b2c价格相关mapper
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2023/12/7
 * @Version 1.0.0
 */
@Mapper
public interface B2CPriceMapper {

    @Select("SELECT  number, wxdj/1.23 price FROM xsjlsheet_pln_2303")
    List<SellPriceBO> getPlnPrice();

    @Select("SELECT UPPER(OrderID) orderId, cpbh, wxdj AS price FROM xsjl_2303 " +
            "where dianpu in ('oeu', 'Dropshop-PL') and state=0 group by OrderID, cpbh, wxdj")
    List<SellPriceBO> getEurPrice();

    @Select("<script>" +
            "SELECT UPPER(OrderID) orderId, cpbh, wxdj AS price, curr_ora currency FROM xsjl_2303 where orderid in " +
            "<foreach collection='orderIdList' item='item' open='(' separator=',' close=')'>#{item}</foreach> " +
            "group by OrderID, cpbh, wxdj, curr_ora" +
            "</script>")
    List<SellPriceBO> getOtherPrice(@Param("orderIdList") Set<String> orderIdList);
}
